<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[title]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('背景图标')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="male"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group" data-favisible="type=2">
        <label class="control-label col-xs-12 col-sm-2">{:__('应用ID')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-applicationId" class="form-control" name="row[applicationId]" type="text" >
        </div>
    </div>
    <div class="form-group" data-favisible="type=2">
        <label class="control-label col-xs-12 col-sm-2">{:__('表单ID')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-formModelId" class="form-control" name="row[formModelId]" type="text">
        </div>
    </div>
    <div class="form-group" data-favisible="type=1">
        <label class="control-label col-xs-12 col-sm-2">{:__('自定义字段')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <table class="table fieldlist" data-name="row[multiplejson]" data-template="row[multiplejson]tpl"
            id="second-table">
            <tr>
                <td>{:__('multiplejson title')}</td>
                <td>{:__('multiplejson type')}</td>
                <td>{:__('字段配置')}</td>
                <td width="90">{:__('Operate')}</td>
            </tr>
            <tr>
                <td colspan="3">
                    <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>
                        {:__('Append')}</a>
                    <textarea name="row[multiplejson]" class="form-control hide" cols="30"
                        rows="5"></textarea>
                </td>
            </tr>
        </table>
        <script type="text/html" id="row[multiplejson]tpl">
            <tr>
                <td><input type="text" name="<%=name%>[<%=index%>][title]" data-rule="required" class="form-control" value=""/></td>
                <td>
                    <select  id="c-type" class="form-control selectpicker" name="<%=name%>[<%=index%>][type]">
                        {foreach name="fieldList" item="vo"}
                            <option value="{$key}"  <%if(row.id=={$key}){%>selected<%}%>>{$vo}</option>
                            <!-- <option value="{$key}" {in name="key" value="<%=row.id%>"}selected{/in}>{$vo}-{$key}-<%=row.id%></option> -->
                        {/foreach}
                    </select>
                    <!-- <input type="text" name="<%=name%>[<%=index%>][id]" data-rule="required" class="form-control selectpage" data-source="ajax/fieldType" value="2"/> -->
                </td>
                <td> <textarea name="<%=name%>[<%=index%>][config]" class="form-control " cols="30" rows="3" ><%=row.config%></textarea></td>
                <td width="90">
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </td>
            </tr>
        </script>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
